package com.my.chapter16;

import net.mindView.utils.Generated;
import net.mindview.util.Generator;

import java.util.Arrays;
import java.util.List;

public class practice15 {
    public static void main(String[] args) {
        BSGenerator gen = new BSGenerator();
        BerylliumSphere[] spheres = Generated.array(
                BerylliumSphere.class, gen, 5);
        System.out.println(Arrays.toString(spheres));
        System.out.println(spheres[4]);

        List<BerylliumSphere> sphereList = Arrays.asList(
                Generated.array(BerylliumSphere.class, gen, 5));
        System.out.println(sphereList);
        System.out.println(sphereList.get(4));
    }
}

class BSGenerator implements Generator<BerylliumSphere> {
    public BerylliumSphere next() {
        return new BerylliumSphere();
    }
}
